{include file="public/header" /}
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>资讯标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$title|default=''}" name="title" datatype="*" nullmsg="标题不能为空">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章摘要：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="desc" class="textarea"  placeholder="文章摘要内容..." >{$desc|default=''}</textarea>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章类型：</label>
			<div class="formControls col-xs-4 col-sm-4">
				<span class="select-box">
				<select name="type" class="select">
                    <option value='0' {if isset($type) && $type == 0 }selected{/if}>公司简介</option>
                    <option value='1' {if isset($type) && $type == 1 }selected{/if}>公告</option>
				</select>
				</span>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章内容：</label>
			<div class="formControls col-xs-8 col-sm-9"> 
                <textarea style="height: 500px;" name="content" class="textarea"  placeholder="文章摘要内容..." >{$content|default=''|raw}</textarea>
			</div>
		</div>
		<div class="row cl">
			<div class="col-8 col-offset-2">
				<input type="hidden" name="id" value="{$id|default=''}">
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
				<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
{include file="public/footer" /}
<script type="text/javascript">
$(function(){
    $("#form-add").validate({
        rules:{
            username:{
                required:true,
                maxlength:16
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $(form).ajaxSubmit({
                success:function(data){
                    console.log(data);
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.location.reload();
                            parent.layer.close(index);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(error){
                    layer.msg('系统发生了错误',{icon:2,time:3000,shade: [0.5, '#FF0000']});
                }
            });

        }
    });
});
</script> 
<script type="text/javascript">
$(function(){
	//选择框
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});
</script>
</body>
</html>